package com.course.web.view;

import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.spring.annotation.UIScope;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;

/**
 * Created by Justin on 2017/5/18.
 */
@SpringComponent
@UIScope
public class AccessDeniedView extends CustomComponent implements View {

    public AccessDeniedView() {
        VerticalLayout root = new VerticalLayout();
        root.addComponent(new Label("Please Sign in"));
        root.addComponent(new Button("Sign in", event -> getUI().getNavigator().navigateTo(LoginView.NAME)));
        setCompositionRoot(root);
        setSizeFull();
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent event) {
    }
}
